package com.lemon.smartsafety.entity.base;

/**
 * Created by Cooliean on 16/1/20.
 */
public class HandlerResult {
    private Object result;
    private ErrorResponse error;
    private boolean isError = false;

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public ErrorResponse getError() {
        if (error == null) {
            error = new ErrorResponse();
        }
        return error;
    }

    public void setError(ErrorResponse error) {
        this.error = error;
    }

    public boolean isError() {
        return isError;
    }

    public void setError(boolean error) {
        isError = error;
    }


    public HandlerResult(Object result, ErrorResponse error, boolean isError) {
        this.result = result;
        this.error = error;
        this.isError = isError;
    }

    public HandlerResult(Object result, boolean isError) {
        this.result = result;
        this.isError = isError;
    }

    public HandlerResult() {
    }
}
